//
//  SENameCardViewModel.swift
//  SmartEyeForDoctor
//
//  Created by qdsg on 2021/5/9.
//

import UIKit

class SENameCardViewModel: SEBaseViewModel {

    var model = SENameCardModel()

    var userInfoModel = SEUserInfoModel()
    
    var avatarPlaceholder: UIImage? {
        UserDefaults.userFemale ? Asset.iconDoctorAvatarFemale.image : Asset.iconDoctorAvatarMale.image
    }

    func requestDoctorQrCode() {
        SEHttpManager.shared.request(SEMineAPI.doctorQrCode, model: SENameCardModel.self, withLoading: true) { model, status in
            switch status {
            case .success:
                self.model = model ?? self.model
                self.userInfoModel = model?.doctorDetail ?? self.userInfoModel
            default:
                break
            }
            self.updateData?(status)
        }
    }

}
